package com.catazy.module_collect.service

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.catazy.module_collect.repository.CollectRepository
import com.catazy.module_collect.viewmodel.CollectViewModel
import com.catazy.wanandroid.common_base.constants.RouterPath
import com.catazy.wanandroid.common_service.collect.CollectService

/**
 * 作者: Tao
 * 日期: 2024/4/15
 * 时间: 10:04
 * 描述: 收藏服务实现类
 */
@Route(path = RouterPath.Main.SERVICE_COLLECT)
class CollectServiceImpl : CollectService {

    private val viewModel = CollectViewModel(CollectRepository.instance)

    override fun collect(indexPage: Int, position: Int, pageId: Int) {
        viewModel.collectArticle(indexPage, position, pageId)

    }

    override fun unCollect(indexPage: Int, position: Int, pageId: Int) {
        viewModel.unCollectArticle(indexPage, position, pageId)
    }

    override fun init(p0: Context?) {
    }
}